package com.njtoyo.taxi.admin.rest.presenter.business.simple_call.backlog;

import com.njtoyo.taxi.admin.library.common.GeoPoint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@ApiModel("未处理的电召数据")
public class InitRecordListPresenter {

    @ApiModelProperty("id")
    private Long id;

    @ApiModelProperty("编号，取ID的后四位，不够的补零")
    private String serialNumber;

    @ApiModelProperty(value = "呼叫号码")
    private String mobileNumber;

    @ApiModelProperty(value = "区域编码")
    private String adCode;

    @ApiModelProperty(value = "出发地坐标")
    private GeoPoint origin;

    @ApiModelProperty(value = "出发地名称")
    private String originName;

    @ApiModelProperty(value = "出发地详细名称")
    private String originPlaceName;

    @ApiModelProperty(value = "语音文件地址")
    private String audioUrl;

    @ApiModelProperty(value = "系统自动发单时间")
    private Long systemSendTimestamp;

    @ApiModelProperty(value = "创建时间")
    private Date createdAt;

    @ApiModelProperty(value = "修改时间")
    private Date updatedAt;

    public void setId(Long id) {
        this.id = id;
        String serialNumber = String.valueOf(id);
        serialNumber = serialNumber.substring((serialNumber.length() > 4) ? serialNumber.length() - 4 : 0);
        this.serialNumber =String.format("%04d", Integer.valueOf(serialNumber));
    }
}
